package swu.myt;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloWorldServlet extends HttpServlet {
	
	private static final long serialVersionUID = 2860175534530630813L;

	public void init() {
		System.out.println("initialized!");
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
		System.out.println("get.");
		this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
		System.out.println("Servlet Serving");

		String username = request.getParameter("name");
		String userpass = request.getParameter("pass");
		
		System.out.println("username:"+username+"\t userpass:"+userpass);

	}
	public void destory() {
		System.out.println("Servlet Destoried.");
	}
}
